package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_post_reply;

//DAO
public interface U_post_replyMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_POST_REPLY  WHERE ID = #{id}")
	public ApiU_post_reply findU_post_replyById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM U_post_reply")
	public List<ApiU_post_reply> findU_post_replys();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_post_replysByMap(HashMap condition);

	// 添加
	// @Insert("INSERT INTO U_POST_REPLY (ID, POST_ID, USER_ID, ADD_TIME,
	// CONTENT, RTYPE, TO_UID, IS_ANONYMOUS, IS_AT_ANONYMOUS, IS_DELETE) VALUES
	// (SEQT_POSREPLY_ID.nextVal, #{post_id}, #{user_id}, #{add_time},
	// #{content}, #{rtype}, #{to_uid}, #{is_anonymous}, #{is_at_anonymous},
	// #{is_delete})")
	// @Options(useGeneratedKeys = false, keyProperty = "id")
	public int insertU_post_reply(ApiU_post_reply u_post_reply);

	// 修改
	@Update("UPDATE U_POST_REPLY SET POST_ID = #{post_id}, USER_ID = #{user_id}, ADD_TIME =#{add_time,jdbcType=VARCHAR}, CONTENT = #{content}, RTYPE = #{rtype}, TO_UID = #{to_uid}, IS_ANONYMOUS = #{is_anonymous}, IS_AT_ANONYMOUS = #{is_at_anonymous}, IS_DELETE = #{is_delete} WHERE ID = #{id}")
	public int updateU_post_reply(ApiU_post_reply u_post_reply);

	// 删除
	// @Delete("DELETE FROM U_POST_REPLY WHERE ID = #{id}")
	@Update("UPDATE U_POST_REPLY SET  IS_DELETE = 1 WHERE ID = #{id}")
	public int deleteU_post_reply(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
